import { useContext } from "react";
import ChatInput from "../ChatInput/index.jsx";
import ChatList from "../ChatList/index.jsx";
import HomePage from "../Home/index.jsx";
import "./index.css";
import AiChatContext from "@/common/context/aiChatContext.js";

const ChatWindow = () => {
  const context = useContext(AiChatContext);

  return (
    <div className="chat-window">
      {context.hasMsg && <div className="chat-header">AI聊天</div>}

      <div className="chat-window-chat">{context.hasMsg ? <ChatList /> : <HomePage />}</div>

      <div className="chat-window-input">
        <ChatInput />
      </div>
    </div>
  );
};

export default ChatWindow;
